<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/1/29
 * Time: 19:00
 */

namespace Xcx\Model;

class GoodsOrderChildModel extends BaseModel
{

    /**
     * 获取订单的商品列表信息
     * @param $orderNo
     * @return mixed
     */
    public function getOrderGoodsList($orderNo)
    {

        $list = $this->alias('a')
            ->field('a.gid,a.spec_id,b.img,b.name,a.count,a.price,c.name spec_name,c.weight')
            ->join('left join t_goods b on a.gid = b.id')
            ->join('left join t_goods_spec c on a.spec_id = c.id')
            ->where(array('order_no'=>$orderNo))
            ->select();

        if (is_array($list) && count($list) > 0) {
            $list = getUploadImgDir($list,array('goods'=>'img'));
        }
        return $list;
    }

}